package cn.tedu.boot31;

import com.alibaba.druid.pool.DruidDataSource;

import java.sql.Connection;
import java.sql.SQLException;

public class Demo05 {
    public static void main(String[] args) throws SQLException {
        DruidDataSource ds = new DruidDataSource();
        ds.setUrl("jdbc:mysql://localhost:3306/empdb" +
                "?characterEncoding=utf8" +
                "&serverTimezone=Asia/Shanghai");
        ds.setUsername("root");
        ds.setPassword("root");
        ds.setInitialSize(3);//设置初始链接数量
        ds.setMaxActive(5);
        Connection conn =ds.getConnection();
        System.out.println(conn);
    }
}
